package top.stmo;

import java.util.Objects;


/**
 *
 *      alt + 鼠标左键      整列编辑
 *
 *      ctrl + r          全选编辑
 *
 *      ctrl + alt + l   格式化代码
 *
 *      实体类中实体属性的基本数据类型改成包装类，因为基本数据类型有默认值
 *
 */
public class Person {

    private Integer id;

    private String name;

    private Long phone;

    public Person() {
    }

    public Person(int id, String name, Long phone) {
        this.id = id;
        this.name = name;
        this.phone = phone;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getPhone() {
        return phone;
    }

    public void setPhone(Long phone) {
        this.phone = phone;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return id == person.id && Objects.equals(name, person.name) && Objects.equals(phone, person.phone);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, phone);
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phone=" + phone +
                '}';
    }
}
